package perso.perso.view.admin.school;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import perso.perso.converteur.BeanSchoolDateConverteur;
import perso.perso.converteur.BeanUserDateConverteur;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamConverter;
import com.thoughtworks.xstream.annotations.XStreamImplicit;


@XStreamAlias("school")
public class BeanSchool {


	@XStreamAsAttribute
	private Integer idEcole;
	@XStreamAsAttribute
	private String libelleSchool;
	@XStreamAsAttribute
	private String adresse1;
	@XStreamAsAttribute
	private String adresse2;
	@XStreamAsAttribute
	private String adresse3;
	@XStreamAsAttribute
	private Integer codePostal;
	@XStreamAsAttribute
	private String ville;
	@XStreamConverter(BeanSchoolDateConverteur.class)
	private Date createDate;
	@XStreamImplicit
	private List<BeanClass> classes = new ArrayList<BeanClass>();
	
	public Integer getIdEcole() {
		return idEcole;
	}
	public void setIdEcole(Integer idEcole) {
		this.idEcole = idEcole;
	}
	
	public String getLibelleSchool() {
		return libelleSchool;
	}
	public void setLibelleSchool(String libelleSchool) {
		this.libelleSchool = libelleSchool;
	}
	public String getAdresse1() {
		return adresse1;
	}
	
	public String getAdresse() {
		return adresse1 + " " + adresse2 + " " + adresse3;
	}
	
	public void setAdresse1(String adresse1) {
		this.adresse1 = adresse1;
	}
	public String getAdresse2() {
		return adresse2;
	}
	public void setAdresse2(String adresse2) {
		this.adresse2 = adresse2;
	}
	public String getAdresse3() {
		return adresse3;
	}
	public void setAdresse3(String adresse3) {
		this.adresse3 = adresse3;
	}
	public Integer getCodePostal() {
		return codePostal;
	}
	public void setCodePostal(Integer codePostal) {
		this.codePostal = codePostal;
	}
	public String getVille() {
		return ville;
	}
	public void setVille(String ville) {
		this.ville = ville;
	}
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
	public List<BeanClass> getClasses() {
		return classes;
	}
	public void setClasses(List<BeanClass> classes) {
		this.classes = classes;
	}
	
	public BeanSchool(){}
	

	public String toString(){
		return this.libelleSchool + "("+this.ville+")";
	}
	
}
